<template>
    <modal
        v-bind="modalProps"
        @confirm="confirm"
        @cancel="cancel"
        @done="$emit('done', lastRes)"
    >
        <div class="alert fade show text-center" role="alert" :class="['alert-' + level]">
            {{info}}    
        </div>
    </modal>
</template>

<script type="text/javascript">
import ajaxModal from '../plugin/ajaxModal'
import {defaultModal as modal} from '../plugin/ajaxModal'
import $ from 'jquery'

export default {
    name: 'confirm-modal',
    props: ['doc', 'args', 'info', 'level'],
    mixins: [ajaxModal],
    components: {modal},
    data() {
        return {
            doc_id: this.doc._id
        }
    },
    computed: {},
    methods: {
        getParams() {
            var vm = this;
            return {
                _id: vm.doc_id,
                args: Object.assign({}, vm.args || {})
            }
        }
    }
}
</script>